package cn.kgc.springbootdemo.mapper;

import cn.kgc.springbootdemo.entity.User;
import cn.kgc.springbootdemo.form.UserPageForm;
import cn.kgc.springbootdemo.vo.UserLoginVO;
import cn.kgc.springbootdemo.vo.UserVO;
import com.baomidou.mybatisplus.annotation.SqlParser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


public interface UserMapper extends BaseMapper<User> {


    /**
     *  用户分页查询
     *
     * @param toPage
     * @param userPageForm
     * @return
     */
    Page<UserVO> userPage(Page toPage, @Param("userPageForm") UserPageForm userPageForm);


    /**
     *  查询用户登录信息
     *
     * @param id 用户Id
     * @return
     */
    UserLoginVO getUserLoginInfoById(@Param("id") String id);

    /**
     *  查询菜单列表
     *
     * @param roleId 角色Id
     * @return
     */
    List<String> getMenusByRoleId(@Param("roleId") Integer roleId);
}
